import * as tslib_1 from "tslib";
import { observable, action } from "mobx";
import request from "../utils/request";
import * as api from "../api/api";
import { LoadHoc, loading } from "../hoc/loadHoc";
/**
 * 律政中心
 */
let LegalStore = class LegalStore extends LoadHoc {
  constructor() {
    super(...arguments);
    /**
     * 首页所有律师数据
     */
    this.AllLawyerInfo = {};
    /**
     * 律师擅长领域列表标签
     */
    this.AreasOfExpertise = {};
    /**
     * 律师详情
     */
    this.lawyerInfo = {};
    /**
     * 省
     */
    this.allProvince = {};
    /**
     * 市
     */
    this.allCity = {};
    /**
     * 区
     */
    this.allDistrict = {};
  }
  async getAllLawyerInfo(params) {
    const { formProvinceId, formCityId, formDistrictId, formAreasOfExpertiseId, pageIndex, pageSize, callback } = params;
    const AllLawyerInfo = await request(api.ApplegalCenterApiFetchParamCreactor.applegalCenterGetAllLawyerInfosAsync({
      formProvinceId,
      formCityId,
      formDistrictId,
      formAreasOfExpertiseId,
      formSkipCount: (pageIndex - 1) * pageSize,
      formMaxResultCount: pageSize
    }));
    this.AllLawyerInfo = AllLawyerInfo;
    callback && callback(AllLawyerInfo);
  }
  async getAreasOfExpertise(params) {
    const { callback } = params;
    const AreasOfExpertise = await request(api.ApplegalCenterApiFetchParamCreactor.applegalCenterGetAreasOfExpertiseAsync({}));
    this.AreasOfExpertise = AreasOfExpertise;
    callback && callback(AreasOfExpertise);
  }
  async getLawyerInfo(params) {
    const { id, callback } = params;
    const lawyerInfo = await request(api.ApplegalCenterApiFetchParamCreactor.applegalCenterGetLawyerInfoAsync({
      formId: id
    }));
    this.lawyerInfo = lawyerInfo;
    callback && callback(lawyerInfo);
  }
  async getAllProvince(params) {
    const { callback } = params;
    const allProvince = await request(api.ApplegalCenterApiFetchParamCreactor.applegalCenterGetAllProvinceAsync({}));
    this.allProvince = allProvince;
    callback && callback(allProvince);
  }
  async getAllCity(params) {
    const { id, callback } = params;
    const allCity = await request(api.ApplegalCenterApiFetchParamCreactor.applegalCenterGetAllCityAsync({
      formId: id
    }));
    this.allCity = allCity;
    callback && callback(allCity);
  }
  async getAllDistrict(params) {
    const { id, callback } = params;
    const allDistrict = await request(api.ApplegalCenterApiFetchParamCreactor.applegalCenterGetAllDistrictAsync({
      formId: id
    }));
    this.allDistrict = allDistrict;
    callback && callback(allDistrict);
  }
};
export { LegalStore as default };

tslib_1.__decorate([observable], LegalStore.prototype, "AllLawyerInfo", undefined);
tslib_1.__decorate([loading, action], LegalStore.prototype, "getAllLawyerInfo", null);
tslib_1.__decorate([observable], LegalStore.prototype, "AreasOfExpertise", undefined);
tslib_1.__decorate([loading, action], LegalStore.prototype, "getAreasOfExpertise", null);
tslib_1.__decorate([observable], LegalStore.prototype, "lawyerInfo", undefined);
tslib_1.__decorate([loading, action], LegalStore.prototype, "getLawyerInfo", null);
tslib_1.__decorate([observable], LegalStore.prototype, "allProvince", undefined);
tslib_1.__decorate([loading, action], LegalStore.prototype, "getAllProvince", null);
tslib_1.__decorate([observable], LegalStore.prototype, "allCity", undefined);
tslib_1.__decorate([loading, action], LegalStore.prototype, "getAllCity", null);
tslib_1.__decorate([observable], LegalStore.prototype, "allDistrict", undefined);
tslib_1.__decorate([loading, action], LegalStore.prototype, "getAllDistrict", null);